﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZL.Web.Utility.Config;

namespace ZL.Web.Utility.Snowflake
{
    public static class SnowflakeService
    {
        //private static Dictionary<long,SnoWorKer> SnoWorKerDic ;

        //private static Dictionary<long, IdWorker> IdWorkerDic;

        public static SnoWorKer SnoWorker;

        public static IdWorker IdWorker;


        public static SnoWorKer CreateSnoWorker(long workerId)
        {

            if (SnoWorker == null)
            {
                SnoWorker = new SnoWorKer(workerId);
            }
            return SnoWorker;
        }

        public static IdWorker CreateIdWorker(long workerId)
        {
            if (IdWorker == null)
                IdWorker = new IdWorker(workerId);
            return IdWorker;
        }
        
    }
}
